//
//  ViewController.m
//  GKTranstionAnimation
//
//  Created by Apple on 16/11/16.
//  Copyright © 2016年 郭凯. All rights reserved.
//

#import "ViewController.h"
#import "GKPresentController.h"

@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (strong, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic,strong) NSArray* datas;
@end

@implementation ViewController

/** 懒加载 */
-(NSArray *)datas{
    if (!_datas) {
        _datas =  @[@"present/pop 动画"];
    }
    return _datas;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    self.automaticallyAdjustsScrollViewInsets = NO;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return self.datas.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    cell.textLabel.text = self.datas[indexPath.row];
    NSLog(@"%@", self.datas[indexPath.row]);
    return cell;
}


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    switch (indexPath.row) {
        case 0:{//present/dissmiss
            GKPresentController *presentVc = [[GKPresentController alloc] init];
            [self.navigationController pushViewController:presentVc animated:YES];
        }
            break;
            
        default:
            break;
    }
}
@end
